Independent T-test

The Student’s t-test is a statistical test that compares the mean and standard deviation of two samples to see if there is a significant difference between them.  In an experiment, a t-test might be used to calculate whether or not differences seen between the control and each experimental group are a factor of the manipulated variable or simply the result of chance.

Picture

The unpaired T-test would be used to determine if there is a significant difference between the control and treated enzyme activities.

Picture

The paired T-test would be used to determine if there is a significant difference between the pre- and post-treatment blood pressures.

The T-test is a test of a  statistical significant difference between two groups.  A "significant difference" means that the results that are seen are most likely not due to chance or sampling error.  In any experiment or observation that involves sampling from a population, there is always the possibility that an observed effect would have occurred due to sampling error alone.  But if result is "significant,"  then the investigator may conclude that the observed effect actually reflects the characteristics of the population rather than just sampling error or chance.  

In any significance test, there are two possible hypothesis:

Null Hypothesis:

"There is not a significant difference between the two groups; any observed differences may be due to chance and sampling error."

For example:  

  • There is no significant difference between the control and treatment group enzyme activity; the difference we see in the means of the two groups may be due to chance and sampling error.
  • There is no significant difference between the blood pressure before and after treatment; the difference we see in the means of the two groups may be due to chance and sampling error.

Alternative Hypothesis:

"There is a significant difference between the two groups; the observed differences are most likely not due to chance or sampling error."

For example:  

  • There is a significant difference between the control and treatment group enzyme activity; the difference seen in the means of the two groups is mostly likely not due to chance or sampling error.
  • There is a significant difference between the blood pressure before and after treatment; the difference we see in the means of the two groups is mostly likely not due to chance or sampling error.

Picture

Where:    

  • x1 is the mean of sample 1          
  • s1 is the standard deviation of sample 1            
  • n1 is the sample size of sample 1                
  • x2 is the mean of sample 2                
  • s2 is the standard deviation of sample 2                
  • n2 is the sample size in sample 2

How to Calculate T:  

The test statistic that a T-test produces is a T-value. The t-value represents how many standard units the means of the two groups are apart.  The larger the t-value, the more likely the two samples are significantly different from each other.

​If you want to calculate your own t-value, follow these steps:

  1. Calculate the mean (X) of each sample
  2. Find the absolute value  of the difference between the means
  3. Calculate the standard deviation for each sample
  4. Square the standard deviation for each sample
  5. Divide each squared standard deviations by the sample size of that group.
  6. Add these two values
  7. Take the square root of the number to find the "standard error of the difference.
  8. Divide the difference in the means (step 2) by  the standard error of the difference (step 7).  The answer is your "calculated T-value."
  9. Determine the degrees of freedom (df) for the test. In the t-test, the degrees of freedom is the sum of the sample sizes of both groups minus 2.
  10. Determine the “Critical T-value” in a table by triangulating your DF and the “p value” of 0.05.  

A p-value s the probability of concluding there is a significant difference between the groups result when the null hypothesis is true (meaning, the probability of making the WRONG conclusion).  In biology, we use a standard “p-value” of 0.05. This means that five times out of a hundred you would find a statistically significant difference between the means even if there was none.  ​​

Picture

11.  Draw your conclusion:  

Sometimes it is nice to check your answers to make sure you are doing the calculations right.  Use this website to check your results.

Performing  a T-test with the TI-83/84 

Picture

  1. Hit the STAT button on the calculator
  2.  Select option 4 to clear any past lists of data.
  3.  Select option 1 to EDIT your lists.
  4. Enter your data for each group as List 1 and List 2
  5. Hit STAT button and use the arrow key to move over to the TESTS option
  6.  Scroll down to option 4, the 2-sample T test and hit ENTER
  7. Scroll to the bottom of the screen and hit ENTER over the CALCULATE option
  8. Your results are given.

Performing a T-test in Google Sheets

Performing a t-test with Excel 

Excel calculates a T-test in a slightly different way.  Rather than giving you the t value and comparing it to a table, Excel simply tells you the probability that the means are different simply due to chance, the “P value.”  Follow these steps to calculate a P value using a t-test with Excel:

  1. Create two columns, side by side, for the data of interest.  Each sample’s data should be in separate columns
  2. Click on another blank cell where you wish the P value to appear.
  3. Then click “fx” on the Excel Formulas toolbar.  
  4. In the box, search for the "T test" function and choose “T.TEST" from the list.  Hit OK.  You will need to set the t-test parameters:

Picture

5.  After answering these questions click “OK” and the P value will appear.  The P value will fall between zero and one.

Picture

What does my P value mean?  Excel gives the chance that the differences between the two samples are due to random chance alone.  If Excel calculates a P value of 0.22, it means that there is a 22% likelihood that the difference in the means of your two data sets is due to random chance.  Normally will say that a P value of .05 or less is significant in which case we reject the null hypothesis (accept the alternative hypothesis).  If the P value is greater than 0.05, we accept the null hypothesis and conclude that there is no significant difference between the two groups.